import http from '@/utils/request'
/**
 * 获取用户频道列表
 * @returns
 */
export const reqGetUserChannels = () => http({
  url: '/v1_0/user/channels',
  method: 'get'
})
/**
 * 获取文章新闻推荐
 * @param {*} channel_id
 * @param {*} timestamp
 * @returns
 */
// eslint-disable-next-line camelcase
export const reqGetArticles = (channel_id, timestamp) => http({
  url: '/v1_0/articles',
  method: 'get',
  params: {
    channel_id,
    timestamp
  }
})

/**
 * 获取所有的频道信息
 */
export const reqGetAllChannels = () => {
  return http({
    method: 'get',
    url: '/v1_0/channels'
  })
}
/**
 *设置用户的频道（重置式）数组包对象
 * @param {*} id
 * @param {*} seq
 * @returns
 */
export const reqSetChannels = (channels) => http({
  url: '/v1_0/user/channels',
  method: 'put',
  data: {
    // channels: [{ id, seq }]
    channels
  }
})
